package com.java.springboot.multi.controller;

import com.java.springboot.multi.config.EnvConfig;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: EnvController
 * @Description: TODO
 * @Author: LiuJiaTao
 * @CreateDate: 2022-03-14
 * @Version : V1.0.0
 */
@RestController
public class EnvController {
    // 定义日志记录器对象
    public static final Logger LOGGER = LogManager.getLogger(EnvController.class);

    @Autowired
    private EnvConfig envConfig;

    /**
     * 浏览器访问：http://localhost:8080/multi
     *
     * @return
     */
    @RequestMapping("/multi")
    public Object multi() {
        LOGGER.info(envConfig);
        return envConfig;
    }
}
